﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Project.Models
{
    public class WebUser :BaseModel
    {
        [StringLength(maximumLength: 20, ErrorMessage = "用户名过长")]
        [Display(Name = "用户名")]
        public string Name { get; set; }

        [Required(ErrorMessage = "{0}必填")]
        [StringLength(64)]
        [Display(Name = "密码")]
        public string LoginPwd { get; set; }

        [StringLength(20)]
        [Display(Name = "手机号")]
        [Required]
        public string Phone { get; set; }

        [StringLength(5)]
        [Display(Name = "性别")]
        public string Sex { get; set; }


        public int Age { get; set; }

        /// <summary>
        /// 状态(0:正常，1：禁用）
        /// </summary>
        public int State { get; set; }


        /// <summary>
        /// 头像
        /// </summary>
        [StringLength(300)]
        public string Image { get; set; }

        /// <summary>
        /// 地址
        /// </summary>
        [StringLength(50)]
        public string Address { get; set; }

        /// <summary>
        /// 介绍
        /// </summary>
        [StringLength(200)]
        public string Description { get; set; }

        /// <summary>
        /// 用户类型（1：雇员，  2：雇主）
        /// </summary>
        public int UserType { get; set; } = 1;

        /// <summary>
        /// 工作经历
        /// </summary>
        public virtual List<WorkHistory> WorkHistories { get; set; }

        /// <summary>
        /// 擅长产品
        /// </summary>
        public virtual List<UserBegoodatRelation> UserBegoodatRelation { get; set; }

        /// <summary>
        /// 擅长设计工具
        /// </summary>
        public virtual List<UserDesignRelation> UserDesignRelations { get; set; }

        public virtual List<Order> Orders { get; set; }

        public virtual List<PriceTemplate> Templates { get; set; }

        public WebUser()
        {
            WorkHistories = new List<WorkHistory>();
            UserBegoodatRelation = new List<UserBegoodatRelation>();
            UserDesignRelations = new List<UserDesignRelation>();
            Orders = new List<Order>();
        }
    }
}
